<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
  <style>
    .el-header {
      font-size: 20px;
      font-weight: bold;
    }
    .el-aside {
      height: 500px;

      padding: 10px;
    }
    .el-main {
      text-align: center;
      height: 500px;

      padding: 10px;
    }
    .el-main>div {
      height: 350px;

      margin: 30px auto;
    }
    .el-aside>div {
    }
    .el-menu-item {
      padding: 0px 40px;
    }
  </style>
</head>
<body>
<div id="app">
  <el-container>
    <el-header>达内后台管理系统</el-header>
    <el-container>
      <el-aside width="200px">
        <div>
          <el-menu
                  default-active="2"
                  class="el-menu-vertical-demo"
                  @open="handleOpen"
                  @close="handleClose">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>员工管理</span>
              </template>
              <el-menu-item index="1-1" style="font-size: 15px;font-weight: bold">员工列表</el-menu-item>
              <el-menu-item index="1-2">添加员工</el-menu-item>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>部门管理</span>
              </template>
              <el-menu-item index="2-1">部门列表</el-menu-item>
              <el-menu-item index="2-2">添加部门</el-menu-item>
            </el-submenu>
          </el-menu>
        </div>
      </el-aside>
        <el-main>
          <h1>员工列表</h1>
          <div>
            <template>
              <el-table
                      :data="arr"
                      style="width: 100%">
                <el-table-column
                        prop="name"
                        label="员工姓名"
                        width="180">
                </el-table-column>
                <el-table-column
                        prop="age"
                        label="员工年龄"
                        width="180">
                </el-table-column>
                <el-table-column
                        prop="job"
                        label="员工工作">
                </el-table-column>
              </el-table>
            </template>
          </div>
        </el-main>
    </el-container>
  </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
 let v = new Vue({
    el: '#app',
    data: function() {
      return {
        arr: [
          {name: "张三",age: "40",job: "保洁"},
          {name: "张三",age: "40",job: "保洁"}
        ],
        e: {name: "", age: "", job: ""}
      }
    },
    methods:{
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    }
  })
</script>
</html>

